home *** CD-ROM | disk | FTP | other *** search
- /* ARexx macro for Textra & SAS/C
-
- 'Build File'
-
- Very simple, really. Simply ask Textra what the current filename is,
- then call SCMSG with the 'build' command.
-
- Modified 30-Dec-1993 by Ron Charlton: use `file.o' as target when
- any makefile exists, otherwise build everything in the directory (I
- cannot convince SCMSG/SMAKE to build only `file.c').
- */
-
- options results /* We *want* results! */
-
- get file name; fname = result
- get file path; fpath = result /* so we can make it ARexx's current directory */
-
- options /* We don't care about results anymore... */
-
- OldDir = pragma(D,fpath) /* make ARexx's current directory where file is */
-
- if (~show('P',SC_SCMSG)) then do
- address command 'run <nil: >nil: SCMSG'
- address command waitforport SC_SCMSG
- end
-
- address SC_SCMSG /* Now talk to SCMSG. Assumes SCMSG is running. */
-
- /* If we find any sort of makefile, target is `file.o', otherwise
- * everything in the directory is built.
- */
- if (exists('smakefile') | exists('smakefile.smk') | exists('makefile') |
- exists('lmkfile') | exists('lmkfile.lmk')) then
- do
- /* Found a makefile.
- * Get the name of the file without an extension.
- * (This will break on `file.ExtraExtension.c'.)
- */
- PARSE VAR fname base '.' extension
- /* Fire up the compiler */
- 'build "' || base || '.o"'
- end
- else
- do
- /* Fire up the compiler */
- 'build' /* NO makefile, so same as running smake in the current dir. */
- end
-
- dummy = pragma(D, OldDir) /* put it back */
-